package com.it.enums.flow;

import lombok.Getter;

/**
 * @author TBH
 * @date 2025-05-14 09:35:52
 * @desc
 */
@Getter
public enum TaskType {
    WAIT(1, "进行中"),
    FINISH(2, "完成"),
    REJECT(3,"拒绝");

    private int code;
    private String type;

    TaskType(int code, String type) {
        this.code = code;
        this.type = type;
    }

    public static TaskType fromCode(int code) {
        for (TaskType taskType : TaskType.values()) {
            if (taskType.code == code) {
                return taskType;
            }
        }
        return null;
    }

    public static String getProgress(int code) {
        for (TaskType processType : TaskType.values()) {
            if (processType.code == code) {
                return processType.type;
            }
        }
        return "";
    }
}